﻿using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace FridgeManagerApp
{
    public class DataListViewModel : NotificationObject
    {
        public DataListViewModel()
        {
            DLBSaveVisibility = Visibility.Hidden;
            EditMode = false;
        }

        #region Property
        public bool EditMode {   get;    set;    }

        private String dlpGoPage;
        public String DLPGoPage
        {
            get
            {
                return dlpGoPage;
            }
            set
            {
                dlpGoPage = value;
                RaisePropertyChanged("DLPGoPage");
            }
        }

        private String dlpPageCount;
        public String DLPPageCount
        {
            get
            {
                return dlpPageCount;
            }
            set
            {
                dlpPageCount = value;
                RaisePropertyChanged("DLPPageCount");
            }
        }

        private String dlpCurrentPage;
        public String DLPCurrentPage
        {
            get
            {
                return dlpCurrentPage;
            }
            set
            {
                dlpCurrentPage = value;
                RaisePropertyChanged("DLPCurrentPage");
            }
        }

        private bool dlpPageUpIsEnabled;
        public bool DLPPageUpIsEnabled
        {
            get
            {
                return dlpPageUpIsEnabled;
            }
            set
            {
                dlpPageUpIsEnabled = value;
                RaisePropertyChanged("DLPPageUpIsEnabled");
            }
        }

        private bool dlpPageDownIsEnabled;
        public bool DLPPageDownIsEnabled
        {
            get
            {
                return dlpPageDownIsEnabled;
            }
            set
            {
                dlpPageDownIsEnabled = value;
                RaisePropertyChanged("DLPPageDownIsEnabled");
            }
        }

        private bool dltIsChecked;
        public bool DLTIsChecked
        {
            get
            {
                return dltIsChecked;
            }
            set
            {
                dltIsChecked = value;
                RaisePropertyChanged("DLTIsChecked");
            }
        }

        private Visibility dltAddVisibility;
        public Visibility DLTAddVisibility
        {
            get
            {
                return dltAddVisibility;
            }
            set
            {
                dltAddVisibility = value;
                RaisePropertyChanged("DLTAddVisibility");
            }
        }

        private Visibility dltEditVisibility;
        public Visibility DLTEditVisibility
        {
            get
            {
                return dltEditVisibility;
            }
            set
            {
                dltEditVisibility = value;
                RaisePropertyChanged("DLTEditVisibility");
            }
        }

        private Visibility dltDeleteVisibility;
        public Visibility DLTDeleteVisibility
        {
            get
            {
                return dltDeleteVisibility;
            }
            set
            {
                dltDeleteVisibility = value;
                RaisePropertyChanged("DLTDeleteVisibility");
            }
        }

        private Visibility dlbSaveVisibility;
        public Visibility DLBSaveVisibility
        {
            get
            {
                return dlbSaveVisibility;
            }
            set
            {
                dlbSaveVisibility = value;
                RaisePropertyChanged("DLBSaveVisibility");
            }
        }        

        #endregion

        #region Command
        protected DelegateCommand<object> dlbSaveCommand;
        public DelegateCommand<object> DLBSaveCommand
        {
            get
            {
                return dlbSaveCommand ?? (dlbSaveCommand = new DelegateCommand<object>(DLSaveCommand, CanDLSaveCommand));
            }
        }

        protected virtual void DLSaveCommand(object obj)
        {

        }

        private bool CanDLSaveCommand(object arg)
        {
            return true;
        }

        protected DelegateCommand<object> dlbQuitCommand;
        public DelegateCommand<object> DLBQuitCommand
        {
            get
            {
                return dlbQuitCommand ?? (dlbQuitCommand = new DelegateCommand<object>(DLQuitCommand, CanDLQuitCommand));
            }
        }

        protected virtual void DLQuitCommand(object obj)
        {

        }

        private bool CanDLQuitCommand(object arg)
        {
            return true;
        }

        protected DelegateCommand<object> dlpGoCommand;
        public DelegateCommand<object> DLPGoCommand
        {
            get
            {
                return dlpGoCommand ?? (dlpGoCommand = new DelegateCommand<object>(DLGoCommand, CanDLGoCommand));
            }
        }

        protected virtual void DLGoCommand(object obj)
        {

        }

        private bool CanDLGoCommand(object arg)
        {
            return true;
        }

        protected DelegateCommand<object> dlpPageUpCommand;
        public DelegateCommand<object> DLPPageUpCommand
        {
            get
            {
                return dlpPageUpCommand ?? (dlpPageUpCommand = new DelegateCommand<object>(DLPageUpCommand, CanDLPageUpCommand));
            }
        }

        protected virtual void DLPageUpCommand(object obj)
        {

        }

        private bool CanDLPageUpCommand(object arg)
        {
            return true;
        }

        protected DelegateCommand<object> dlpPageDownCommand;
        public DelegateCommand<object> DLPPageDownCommand
        {
            get
            {
                return dlpPageDownCommand ?? (dlpPageDownCommand = new DelegateCommand<object>(DLPageDownCommand, CanDLPageDownCommand));
            }
        }

        protected virtual void DLPageDownCommand(object obj)
        {

        }

        private bool CanDLPageDownCommand(object arg)
        {
            return true;
        }

        protected DelegateCommand<object> dltCheckedCommand;
        public DelegateCommand<object> DLTCheckedCommand
        {
            get
            {
                return dltCheckedCommand ?? (dltCheckedCommand = new DelegateCommand<object>(DLCheckedCommand, CanDLCheckedCommand));
            }
        }

        protected virtual void DLCheckedCommand(object obj)
        {

        }

        private bool CanDLCheckedCommand(object arg)
        {
            return true;
        }

        protected DelegateCommand<object> dltAddCommand;
        public DelegateCommand<object> DLTAddCommand
        {
            get
            {
                return dltAddCommand ?? (dltAddCommand = new DelegateCommand<object>(DLAddCommand, CanDLAddCommand));
            }
        }

        protected virtual void DLAddCommand(object obj)
        {

        }

        private bool CanDLAddCommand(object arg)
        {
            return true;
        }

        protected DelegateCommand<object> dltEditCommand;
        public DelegateCommand<object> DLTEditCommand
        {
            get
            {
                return dltEditCommand ?? (dltEditCommand = new DelegateCommand<object>(DLEditCommand, CanDLEditCommand));
            }
        }

        protected virtual void DLEditCommand(object obj)
        {

        }

        private bool CanDLEditCommand(object arg)
        {
            return true;
        }

        protected DelegateCommand<object> dltDeleteCommand;
        public DelegateCommand<object> DLTDeleteCommand
        {
            get
            {
                return dltDeleteCommand ?? (dltDeleteCommand = new DelegateCommand<object>(DLDeleteCommand, CanDLDeleteCommand));
            }
        }

        protected virtual void DLDeleteCommand(object obj)
        {

        }

        private bool CanDLDeleteCommand(object arg)
        {
            return true;
        }

        protected DelegateCommand<object> dltCloseCommand;
        public DelegateCommand<object> DLTCloseCommand
        {
            get
            {
                return dltCloseCommand ?? (dltCloseCommand = new DelegateCommand<object>(DLCloseCommand, CanDLCloseCommand));
            }
        }

        protected virtual void DLCloseCommand(object obj)
        {

        }

        private bool CanDLCloseCommand(object arg)
        {
            return true;
        }
        #endregion
    }
}
